// import { ComponentType } from 'react'
// import {Navigate} from 'react-router-dom'

// let Homelogin =((Com:ComponentType)=>{
//     return()=>{
//         let token = window.localStorage.getItem('token')
//         return token?<Com></Com>:<Navigate to={'/login'}></Navigate>
//     }
// })

// export default Homelogin



import {ComponentType} from 'react'
import { Navigate } from 'react-router-dom'

let Homelogin=((Com:ComponentType)=>{
    return()=>{
        let token = window.localStorage.getItem('token')
        return token?<Com></Com> :<Navigate to='/login'></Navigate>
    }
})


export default Homelogin


